package com.mxpio.erp.common.plm.bo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mxpio.erp.common.plm.entity.ProjectTaskCompleteDeliverableDraft;
import com.mxpio.erp.common.plm.entity.ProjectTaskDeliverable;
import com.mxpioframework.security.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Transient;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
public class ProjectTaskBO implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 任务编码
     */
    private String taskCode;
    /**
     * 任务进度
     */
    private BigDecimal progress;
    /**
     * 正常工时
     */
    private BigDecimal oneNormalWorkTime;
    /**
     * 加班工时
     */
    private BigDecimal oneOvertimeWorkTime;
    /**
     * 完工说明/变更描述/申请原因(关闭)/问题描述
     */
    private String applyDesc;
    /**
     * 日志Id
     */
    private String taskLogId;
    /**
     * 是否同意：0-否，1-是
     */
    private String auditOpinion;
    /**
     * 审核意见描述
     */
    private String auditOpinionDesc;
    /**实际开始日期*/
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @Schema(description = "实际开始日期")
    private Date actualStartTime;
    /**实际结束时间*/
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @Schema(description = "实际结束日期")
    private Date actualEndTime;

    /**实际工期*/
    @Schema(description = "实际工期（天）")
    private BigDecimal actualDuration;

    /**审批状态*/
    @Column(name = "BPMN_STATUS_")
    @Schema(description = "审批状态")
    @Dict(dicCode = "ERP_COMMON_BPMN_STATUS")
    private String bpmnStatus;

    /**审批实例ID*/
    @Column(name = "PROCESS_INSTANCE_ID_")
    @Schema(description = "审批实例ID")
    private String processInstanceId;



    /**
     * 交付物列表
     */
    private List<ProjectTaskDeliverable> deliverables;

//    /**
//     * 任务完工时-交付物草稿表
//     */
//    @Transient
//    private List<ProjectTaskCompleteDeliverableDraft> projectTaskCompleteDeliverableDrafts;
}
